package com.huodongjia.mapper;

import com.huodongjia.pojo.Activity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ActivityMapper {

    @Select("select * from huodongjia.activity")
    public List<Activity> findAll();

    @Select("select * from huodongjia.activity where name like '%${search}%'")
    public List<Activity> search(String search);

    @Select("select * from huodongjia.activity where id=${activityId}")
    public Activity findById(int activityId);
    @Delete("delete from huodongjia.activity where id=${activityId}")
    void delete(int activityId);
}
